package com.hmy.finance.dal.po.receipt;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.hmy.finance.dal.po.receipt.json.CustomerContactorJson;
import com.hmy.finance.dal.po.receipt.json.CustomerInfoJson;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 合同分摊记录
 *
 * @TableName receipt_contract_apportion_record
 */
@TableName(value = "receipt_contract_apportion_record",autoResultMap = true)
@Data
public class ReceiptContractApportionRecordPo implements Serializable {
    /**
     * 主键ID
     */
    @TableId(value = "id",type = IdType.ASSIGN_ID)
    private Long id;

    /**
     * 收款核销申请单主键ID
     */
    @TableField(value = "receipt_offset_bill_id")
    private Long receiptOffsetBillId;

    /**
     * 销售合同主键ID
     */
    @TableField(value = "contract_id")
    private Long contractId;

    /**
     * 销售合同编号
     */
    @TableField(value = "contract_no")
    private String contractNo;

    /**
     * 所属客户主键ID
     */
    @TableField(value = "customer_id")
    private Long customerId;

    /**
     * 所属客户名称
     */
    @TableField(value = "customer_name")
    private String customerName;

//    /**
//     * 所属客户扩展信息
//     */
//    @TableField(value = "customer_extension_info", typeHandler = JacksonTypeHandler.class)
//    private CustomerInfoJson customerExtensionInfo;

    /**
     * 所属客户联系人主键ID
     */
    @TableField(value = "customer_contactor_id")
    private Long customerContactorId;

    /**
     * 所属客户联系人名称
     */
    @TableField(value = "customer_contactor_name")
    private String customerContactorName;

    /**
     * 所属客户联系人扩展信息
     */
    @TableField(value = "customer_contactor_extension_info", typeHandler = JacksonTypeHandler.class)
    private CustomerContactorJson customerContactorExtensionInfo;

    /**
     * 是否核销，0-否；1-是
     */
    @TableField(value = "is_offseted")
    private Integer isOffseted;

    /**
     * 总欠款金额
     */
    @TableField(value = "total_arrears_amount")
    private BigDecimal totalArrearsAmount;

    /**
     * 建议核销金额
     */
    @TableField(value = "suggest_offset_amount")
    private BigDecimal suggestOffsetAmount;

    /**
     * 实际核销金额
     */
    @TableField(value = "actual_offset_amount")
    private BigDecimal actualOffsetAmount;

    /**
     * 核销后欠款金额
     */
    @TableField(value = "offseted_arrears_amount")
    private BigDecimal offsetedArrearsAmount;

    /**
     * 创建时间
     */
    @TableField(value = "create_time")
    private LocalDateTime createTime;

    /**
     * 创建人ID
     */
    @TableField(value = "creator_id")
    private Long creatorId;

    /**
     * 创建人姓名
     */
    @TableField(value = "creator_name")
    private String creatorName;

    /**
     * 更新时间
     */
    @TableField(value = "update_time")
    private LocalDateTime updateTime;

    /**
     * 更新人ID
     */
    @TableField(value = "updater_id")
    private Long updaterId;

    /**
     * 更新人姓名
     */
    @TableField(value = "updater_name")
    private String updaterName;

    /**
     * 是否删除，0-否；1-是
     */
    @TableLogic
//    @TableField(value = "is_deleted")
    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}